# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-drf-orjson-renderer
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=drf_orjson_renderer
pkgver=1.7.3
_gittag=e1fec75de5be6e077cc2238a32c511f43ba855c3
pkgrel=1
pkgdesc="Django RestFramework JSON Renderer Backed by orjson"
url="https://pypi.python.org/project/drf-orjson-renderer"
arch="noarch"
license="MIT"
depends="py3-django-rest-framework py3-orjson"
checkdepends="py3-pytest-django py3-numpy"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/brianjbuck/drf_orjson_renderer/archive/$_gittag.tar.gz
	26_remove-django-numpy-json-encoder.patch"
builddir="$srcdir/$_pkgreal-$_gittag"
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
9946d28e14c70e8511fe8a108db5e9acba6f5517719158903b11d6bce723a99d164b867167e2cd75e853249ffd1c5845f97f17f77e0e0c99b2497a6657e5bc13  py3-drf-orjson-renderer-1.7.3.tar.gz
621be2d9f237286ef342116cbdf666bde41ca03bc7c38baa14a21e93d7324016dbdcd57079059eea701a588a64b9ffdab2ef2eff22ebf82a0ff1f3ecc08602d8  26_remove-django-numpy-json-encoder.patch
"
